import Vue from 'vue'

import { Icon } from 'ant-design-vue'
import iconFront from './icon/iconfont.js'

const icon = Icon.createFromIconfontCN({
  scriptUrl: iconFront
})
Vue.component('icon', icon)

export const trans = [
  { key: 'Input', title: '输入', open: false },
  { key: 'Output', title: '输出', open: false },
  { key: 'Streaming', title: 'Streaming', open: false },
  { key: 'Transform', title: '转换', open: false },
  { key: 'Utility', title: '应用', open: false },
  { key: 'Flow', title: '流程', open: false },
  { key: 'Scripting', title: '脚本', open: false },
  { key: 'Lookup', title: '查询', open: false },
  { key: 'Joins', title: '连接', open: false },
  { key: 'DataWarehouse', title: '数据仓库', open: false },
  { key: 'Validation', title: '检验', open: false },
  { key: 'Statistics', title: '统计', open: false },
  { key: 'BigData', title: 'Big Data', open: false },
  { key: 'Cryptography', title: '加密', open: false },
  { key: 'Bulk', title: '批量加载', open: false }
]

export const transNode = {
  'Input': [
    { key: 'CsvInput', title: 'CSV文件输入', icon: 'kettle-TFI', file: 'csv' },
    { key: 'ExcelInput', title: 'Excel输入', icon: 'kettle-XLI', file: 'excel' },
    { key: 'JsonInput', title: 'Json输入', icon: 'kettle-JSI', file: 'json' },
    { key: 'TableInput', title: '表输入', icon: 'kettle-TIP', file: 'table' }
  ],
  'Output': [
    { key: 'ExcelOutput', title: 'Excel输出', icon: 'kettle-XLO', file: 'excel' },
    { key: 'JsonOutput', title: 'Json输出', icon: 'kettle-JSO', file: 'json' },
    { key: 'SqlFileOutput', title: 'SQL文件输出', icon: 'kettle-SFO', file: 'sql' },
    { key: 'XmlOutput', title: 'Xml输出', icon: 'kettle-XOU', file: 'xml' },
    { key: 'TextFileOutput', title: '文本文件输出', icon: 'kettle-TFO', file: 'text' },
    { key: 'TableOutput', title: '表输出', icon: 'kettle-TOP', file: 'table' },
    { key: 'PropertyOutput', title: '配置文件输出', icon: 'kettle-PFO', file: 'property' }
  ],
  'Streaming': [
    { key: 'JmsConsumer', title: 'JMS消费者', icon: 'kettle-JMSC', file: 'jms-consumer' },
    { key: 'JmsProducer', title: 'JMS生产者', icon: 'kettle-JMSP', file: 'jms-producer' },
    { key: 'MqttConsumer', title: 'MQTT消费者', icon: 'kettle-MQTTConsumer', file: 'mqtt-consumer' },
    { key: 'MqttProducer', title: 'MQTT生产者', icon: 'kettle-MQTTProducer', file: 'mqtt-producer' }
  ],
  'Transform': [
    { key: 'ValueMapper', title: '值映射', icon: 'kettle-VMAP', file: 'value-mapper' },
    { key: 'SplitFieldToRows', title: '列拆分成多行', icon: 'kettle-SFtR', file: 'split-field-to-rows' },
    { key: 'Denormaliser', title: '列转行', icon: 'kettle-UNP', file: 'denormaliser' },
    { key: 'StringCut', title: '剪切字符串', icon: 'kettle-SRC', file: 'string-cut' },
    { key: 'Unique', title: '去除重复记录', icon: 'kettle-UNQ', file: 'unique' },
    { key: 'UniqueRowsByHashSet', title: '唯一行（哈希值）', icon: 'kettle-URH', file: 'unique-by-hash' },
    { key: 'constant', title: '增加常量', icon: 'kettle-CST', file: 'constant' },
    { key: 'sequence', title: '增加序列', icon: 'kettle-SEQ', file: 'sequence' },
    { key: 'SelectValues', title: '字段选择', icon: 'kettle-SEL', file: 'select-values' },
    { key: 'StringOperations', title: '字符串操作', icon: 'kettle-STM', file: 'string-operations' },
    { key: 'ReplaceString', title: '字符串替换', icon: 'kettle-RST', file: 'replace-string' },
    { key: 'FieldSplitter', title: '拆分字段', icon: 'kettle-SPL', file: 'field-splitter' },
    { key: 'SortRows', title: '排序记录', icon: 'kettle-SRT', file: 'sort-rows' },
    { key: 'Normaliser', title: '行转列', icon: 'kettle-NRM', file: 'normaliser' }
  ],
  'Utility': [
    { key: 'WriteToLog', title: '写日志', icon: 'kettle-WTL', file: 'write-to-log' },
    { key: 'SendMail', title: '发送邮件', icon: 'kettle-MAIL', file: 'send-mail' },
    { key: 'Ssh', title: '运行SSH命令', icon: 'kettle-SSH', file: 'ssh' }
  ],
  'Flow': [
    { key: 'Dummy', title: '空操作', icon: 'kettle-DUM', file: 'dummy' }
  ],
  'Scripting': [
    { key: 'Janino', title: 'Java代码', icon: 'kettle-janino', file: 'java' },
    { key: 'JsScripting', title: 'JavaScript代码', icon: 'kettle-SCR_exe', file: 'javascript' },
    { key: 'Formula', title: '公式', icon: 'kettle-FRM', file: 'formula' },
    { key: 'ExecSql', title: '执行SQL脚本', icon: 'kettle-SQL', file: 'sql' },
    { key: 'RegexEval', title: '正则表达式 ', icon: 'kettle-RGE', file: 'regex-eval' }
  ],
  'Lookup': [
    { key: 'Http', title: 'HTTP Get查询', icon: 'kettle-WEB', file: 'http' },
    { key: 'HttpPost', title: 'HTTP Post查询', icon: 'kettle-janino', file: 'http-post' },
    { key: 'Rest', title: 'Rest Client查询', icon: 'kettle-REST', file: 'rest' },
    { key: 'DbLookup', title: '数据库查询', icon: 'kettle-DLU', file: 'db' }
  ],
  'Joins': [
    { key: 'MergeRows', title: '合并记录', icon: 'kettle-MRG', file: 'merge-rows' },
    { key: 'SortedMerge', title: '排序合并', icon: 'kettle-SMG', file: 'sorted-merge' },
    { key: 'JoinRows', title: '记录关联（笛卡尔输出）', icon: 'kettle-JRW', file: 'join-rows' },
    { key: 'MergeJoin', title: '记录集连接', icon: 'kettle-MJOIN', file: 'merge-join' }
  ]
}

export const job = [
]

export const jobNode = {

}
